import { http } from '@/utils/http/axios';

/**
 * @description: 角色列表
 */
export function getRoleList() {
  return http.request({
    url: '/role/list',
    method: 'GET',
  });
}
/**
 * 新增员工
 */
export function addPersons(params) {
  return http.request({
    url: '/person',
    method: 'post',
    params,
  });
}
// 获取员工信息
export function getPerson(params) {
  return http.request({
    url: '/person/infos',
    method: 'get',
    params,
  });
}
//修改权限
export function putRole(params) {
  return http.request({
    url: `/person/info/${params.id}`,
    method: 'put',
    params,
  });
}
// 添加用户
export function addUser(v: number, k: number, id: number) {
  return http.request({
    url: '/user',
    method: 'post',
    data: { username: v, password: k, person: id },
  });
}
// 模糊查询
export function getMohu(v) {
  // console.log('v' + v);
  return http.request({
    url: '/person/info',
    method: 'get',
    params: { name: v },
  });
}
export function addPerson(personForm) {
  return http.request({
    url: 'http://localhost:8001/api/person',
    method: 'POST',
    data: personForm,
  });
}
export function addAddress(formValue) {
  return http.request({
    url: 'address',
    method: 'POST',
    params: formValue,
  });
}
export function personName(N) {
  return http.request({
    url: '/person/name',
    method: 'GET',
    params: { name: N },
  });
}
